package com.hxc.web.controller.common;

import com.hxc.common.core.domain.AjaxResult;
import com.hxc.common.utils.PointUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.Map;

@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/point")
@Api(tags = "地图坐标管理")
public class PointController {

    @ApiOperation(value = "根据地址获取经纬度")
    @GetMapping("/getAddressPoint/{address}")
    public AjaxResult getLatitudeAndLongitude(@PathVariable String address) throws IOException {
        Map<String, String> map = PointUtils.getLatitudeAndLongitude(address);
        return AjaxResult.success("success", map);
    }

}
